package com.whc.orders;

import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.graphql.tester.AutoConfigureGraphQlTester;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author 韦红材
 * @ClassName RabbitMqTest
 * @data 2025/02/22 19:26
 * @Version V1.0
 **/
@SpringBootTest
public class RabbitMqTest {
    @Resource
    private RabbitTemplate rabbitTemplate;

    @Test
    public void testMq(){
        // 队列名称
        String queueName = "simple.queue";
        // 消息
        String message = "hello, spring amqp!";
        // 发送消息
        rabbitTemplate.convertAndSend(queueName, message);
    }
}
